<template>
	<div class="errorLog-container">
		<el-divider content-position="left">
			这里会在顶部navbar上模拟一个控制台错误日志
		</el-divider>
		<el-button type="primary" @click="handleError" v-if="button.VUE的错误">
			点击模拟一个VUE的错误
		</el-button>
		<el-button type="primary" @click="handleError2" v-if="button.JS的错误">
			点击模拟一个JS的错误
		</el-button>
		<error-test v-if="show" />
	</div>
</template>

<script>
	import ErrorTest from "./components/ErrorTest";
	import common from "@/common/common.js";

	export default {
		name: "ErrorLog",
		components: {
			ErrorTest
		},
		mixins: [common.baseVM],
		data() {
			return {
				button: {
					VUE的错误: true,
					JS的错误: true
				},
				show: false
			};
		},
		methods: {
			handleError() {
				this.show = true;
			},
			handleError2() {
				var a = null;
				alert(a.a);
			},
		},
	};
</script>
